unit U_KargoAtama;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, Grids, Wwdbigrd, Wwdbgrid, DB,
  ADODB, siComp;

type
  TfmKargoAtama = class(TForm)
    wwDBGrid1: TwwDBGrid;
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    adoTemp: TADOQuery;
    adoGrid: TADOQuery;
    DS: TDataSource;
    procedure BitBtn2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    KargoID:integer;
  end;

var
  fmKargoAtama: TfmKargoAtama;

implementation
  uses Data,ana1;
{$R *.dfm}

procedure TfmKargoAtama.BitBtn2Click(Sender: TObject);
begin
close;
end;

procedure TfmKargoAtama.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
   action:=Cafree;
   fmKargoAtama:=nil;
end;

procedure TfmKargoAtama.BitBtn1Click(Sender: TObject);
begin
   anaform.MODALRESULT[1]:= adoGrid.FieldValues['id'];
   ModalResult:=mrok;
end;

procedure TfmKargoAtama.FormShow(Sender: TObject);
begin
 adoGrid.close;
 adoGrid.SQL.Text:='select * from dbo.tbl_KargoTanim where Aktif=1 Order by ID';
 adoGrid.Open;

 adoGrid.Locate('ID',KargoID,[]);
end;

end.